package com.juyu.miliao.api.controller;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.juyu.miliao.api.domain.Gift;
import com.juyu.miliao.api.service.GiftService;

/**
 * 礼物信息
 * @author wbf
 * 2018年6月25日
 */
@RestController
@RequestMapping("/gift")
public class GiftController {

	@Resource
	GiftService giftService;

	@GetMapping
	public List<Gift> getGiftList() {
		return giftService.getGiftList();
	}

	@GetMapping("/{id}")
	public Gift getGiftById(@PathVariable("id")int id){
		return giftService.getGiftById(id);
	}

	/**
	 * 获取礼物列表
	 * @param type 礼物类型1：普通礼物 2 vip礼物 3 奢华礼物
	 */
	@GetMapping("list/{type}")
	public List<Gift> getGiftListByType(@PathVariable("type")int type) {
		return giftService.getGiftListByType(type);
	}
}
